package com.lmxdawn.api.dnf.dto;

import com.github.wxpay.sdk.WXPayConfig;
import com.lmxdawn.api.dnf.util.AesUtil;
import lombok.Data;

import java.io.InputStream;

@Data
public class WxpayConfig implements WXPayConfig {

    private String appid = "wx45dd9609efa0b1aa";
    private String mchId = "1684756543";
    private String appSecret = "997c562963c7b5d4480a27e29c3cc6d2";
    private String appKey = "75fdb5e7c2390f2c547d4392d947cea1";
    private String serialNumber = "29C9AE7DF6997903C09B781D13992C906EE2BA2C";
    private String apiV3Key = "Zxh1314Zxh1314Zxh1314Zxh1314Zxh1";
    private String privateKeyPath = "/certs/wx/apiclient_key.pem";

    private AesUtil aesUtil ;

    public AesUtil getAesUtil() {
        if (aesUtil == null){
            return new AesUtil(this.apiV3Key.getBytes());
        }
        return aesUtil;
    }

    @Override
    public String getAppID() {
        return appid;
    }

    @Override
    public String getMchID() {
        return mchId;
    }

    @Override
    public String getKey() {
        return appKey;
    }

    @Override
    public InputStream getCertStream() {
        return null;
    }

    @Override
    public int getHttpConnectTimeoutMs() {
        return 3000; // 默认连接超时时间为 3 秒
    }

    @Override
    public int getHttpReadTimeoutMs() {
        return 8000; // 默认读取超时时间为 8 秒
    }
}
